package com.hehua.InterpreterPattern;

/**
 * and类充当非终结符表达式角色
 */
public class AndNode extends AbstractNode{
    /**
     * and的左表达式
     */
    private AbstractNode left;

    /**
     * and的右表达式
     * @return
     */
    private AbstractNode right;

    public AndNode(AbstractNode left, AbstractNode right) {
        this.left = left;
        this.right = right;
    }

    /**
     * and表达式解释操作
     * @return
     */
    @Override
    public String interpret() {
        return left.interpret()+"再"+right.interpret();
    }
}
